package com.relife.common.bean;

import java.text.MessageFormat;

/**
 * 静态生成模板配置
 * 
 * @author WU
 * @date 2015-4-30 下午3:59:38
 */
public class HtmlConfig {

	private String name;// 配置名称
	private String description;// 描述
	private String ftlPath;// Freemarker模板文件路径
	private String htmlPath;// 生成HTML静态文件存放路径
	private String classPath;
	private String htmlName = "";

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getFtlPath() {
		return ftlPath;
	}

	public void setFtlPath(String ftlPath) {
		this.ftlPath = ftlPath;
	}

	public String getHtmlPath() {
		return htmlPath;
	}

	public void setHtmlPath(String htmlPath) {
		this.htmlPath = htmlPath;
	}

	public String getRealPath() {
		return classPath + ftlPath.substring(0, ftlPath.lastIndexOf("/"));
	}

	public String getRealName() {
		return ftlPath.substring(ftlPath.lastIndexOf("/") + 1, ftlPath.length());
	}

	public String getSaveName() {
		String fileName = htmlPath.substring(htmlPath.lastIndexOf("/") + 1, htmlPath.length());
		return MessageFormat.format(fileName, htmlName);
	}

	public String getSavePath() {
		return classPath + htmlPath.substring(0, htmlPath.lastIndexOf("/"));
	}

	public String getClassPath() {
		return classPath;
	}

	public void setClassPath(String classPath) {
		this.classPath = classPath;
	}

	public String getHtmlName() {
		return htmlName;
	}

	public void setHtmlName(String htmlName) {
		this.htmlName = htmlName;
	}

}